//Input manager for DirectX game

#ifndef DXGAMEINPUT_H
#define DXGAMEINPUT_H

#include <dinput.h>
#include "game.h"

#define KEYBOARD_BUFFER_SIZE 1024
#define MASK 0x80

using namespace game;

class DXGameInput : public GameInput
{	
  public:
    DXGameInput();
    DXGameInput(HWND);
    virtual bool Init();
    virtual void GetState();
    virtual bool IsKeyDown(unsigned char);
    virtual bool IsKeyUp(unsigned char);
    virtual bool IsKeyPress(unsigned char);
    virtual bool IsKeyRelease(unsigned char);
    virtual bool IsMouseDown(unsigned char);
    virtual bool IsMouseUp(unsigned char);
    virtual bool IsMouseMove();
    virtual float GetMouseMove_X();
    virtual float GetMouseMove_Y();
    virtual float GetMouseMove_Z();
    virtual float GetPosX();
    virtual float GetPosY();
    virtual ~DXGameInput();
		
  private:
    HINSTANCE hInstance;								//Handle game instance
    HWND hWnd;											//Handle window 
    IDirectInput8* pDInput;								//Pointer to interface DirectX input
    IDirectInputDevice8* pKeyboardDevice;				//Pointer to interface keyboard device
    IDirectInputDevice8* pMouseDevice;					//Pointer to interface mouse device
    char keyState[256];									//Store state of keys 
    bool keyPress[256];									//Flag to check key pressed
    DIDEVICEOBJECTDATA keyEvent[KEYBOARD_BUFFER_SIZE];	//Use check key press
    DIMOUSESTATE mouseState;							//Store state of mouse
    POINT position;										//Position of mouse on screen
};

#endif